UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2upKcAc4Dkd0ESFXv5wYMZi0EW9m4NepJdmtsCieTpA=' 
WHERE 
  key_id = '2cc98c0900f98ead5701a34e660fe64566944a0d076b4e39d7cb43ce9f21e53e' 
  AND (
    token = '2upKcAc4Dkd0ESFXv5wYMZi0EW9m4NepJdmtsCieTpA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034