UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd2pzdj+CGwhh4yWGXBj01375F9D3V43cWzpmxlBnm4w=' 
WHERE 
  key_id = '724d5e61a0a24e5812e6c9d0e57cafe185ade0cb4704080887afa051d110a99a' 
  AND (
    token = 'd2pzdj+CGwhh4yWGXBj01375F9D3V43cWzpmxlBnm4w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033