UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zMWh5E9pG7sYpamI+DT+CmTKEND1CMfYjuy6A2hcrdg=' 
WHERE 
  key_id = '1c8340d62fd3110219f4a092bcae1addaa3b3cf0526b8fa6618938d7e0cbc558' 
  AND (
    token = 'zMWh5E9pG7sYpamI+DT+CmTKEND1CMfYjuy6A2hcrdg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028