UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5hrv5h/dPQEI1HTDb8pfYPYSW8R/NqSVNncazAmfj0I=' 
WHERE 
  key_id = '95bf74eeb0291c6876f9d4ecf2cec351ff03469824c3127f2556d9f66c297cb3' 
  AND (
    token = '5hrv5h/dPQEI1HTDb8pfYPYSW8R/NqSVNncazAmfj0I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032