UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bJJhcQFJckMCkqHEp0xrJalBT6FO6P3KEKIpOmoGhfI=' 
WHERE 
  key_id = '0f4118f9b3b844a65f3910ecbb7f8967c099bc760034367eac2ae00c9b6294a4' 
  AND (
    token = 'bJJhcQFJckMCkqHEp0xrJalBT6FO6P3KEKIpOmoGhfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045