UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OxGdUCSP2rSeNbWOkjyQDy1+jyyTy2X5rdYlyOcXnN0=' 
WHERE 
  key_id = '66219119f68edbb9b51924c6c0e58408087d657c454582ab7f46070d6f643ce9' 
  AND (
    token = 'OxGdUCSP2rSeNbWOkjyQDy1+jyyTy2X5rdYlyOcXnN0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034