UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Aq5Z5NtQJZ3YW6lxIT1rF/7KWXF/VLhbGgWGeoGxkQA=' 
WHERE 
  key_id = '1828a25842b11d9c5ec809991390711c56af5533fbe4fb03efb269c8da99c824' 
  AND (
    token = 'Aq5Z5NtQJZ3YW6lxIT1rF/7KWXF/VLhbGgWGeoGxkQA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034