UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mLc3OKRc1ZLQC5TtDIUROn5RNp+QM1gQK37Lwg3U1fQ=' 
WHERE 
  key_id = '091dc0918c783eca86aa189bd557bb117c59a5e9303355730e504ee920fa7a29' 
  AND (
    token = 'mLc3OKRc1ZLQC5TtDIUROn5RNp+QM1gQK37Lwg3U1fQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020