UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VXzdkq29ztxvICi2qAIIxxtKXGDIhly6vRcH6ucrk3w=' 
WHERE 
  key_id = 'dec7386b5131f97a731cb5a35c4b67fddc151e96071d370c5209ecd0555b4cf2' 
  AND (
    token = 'VXzdkq29ztxvICi2qAIIxxtKXGDIhly6vRcH6ucrk3w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031