UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ruh6Xf5fC/B+65Pp4Dy6ON16ZS1/IbGr+YGfmdWZ4lk=' 
WHERE 
  key_id = '601baae46064a8625be67d33285bdc8eebc716cb2568a4351b85cb54ee3b5acc' 
  AND (
    token = 'Ruh6Xf5fC/B+65Pp4Dy6ON16ZS1/IbGr+YGfmdWZ4lk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049