UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i98XT4UGjzvx5aGZVem8/09UBdlco50Ltcnkhe3dxMk=' 
WHERE 
  key_id = 'e1e28fa1e070cb9dbd58376552ca28fbf8c993c0189b31e59e32afff402e5478' 
  AND (
    token = 'i98XT4UGjzvx5aGZVem8/09UBdlco50Ltcnkhe3dxMk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022