UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4iI0LNaT/I7cZz70BLjWGZJfq/8bbSavPIcRIoQDP/8=' 
WHERE 
  key_id = '886b8efbe5df698c77035e9c32762cb37d31704e6d082778a54996542177793f' 
  AND (
    token = '4iI0LNaT/I7cZz70BLjWGZJfq/8bbSavPIcRIoQDP/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035