UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MBvP28dKWu3VmavizcyQv/JtpQoWK7IMdRWlqmFft5E=' 
WHERE 
  key_id = 'fdcb7af7078f59a033e06c3baf16b1d263808f5f6a470068fd912e8e983e9221' 
  AND (
    token = 'MBvP28dKWu3VmavizcyQv/JtpQoWK7IMdRWlqmFft5E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033