UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e6vJ7WEb++JrF0WcEzKJjtF57VAbDDpUB2V/7HPaf5Q=' 
WHERE 
  key_id = '4d7e9ea4725f73d2a07c35e851955809bd3d21c5695cfbc4f386ba363085e5e4' 
  AND (
    token = 'e6vJ7WEb++JrF0WcEzKJjtF57VAbDDpUB2V/7HPaf5Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052