UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8ZVeX42QkS6lFwmVUJGzDvmg3mtqo41Worq1SOI5yLw='
WHERE
key_id = 'e600a51f4720084be1e3cc80619b455ecf2b26842461b793cc312998cfcc7613'
AND (
token = '8ZVeX42QkS6lFwmVUJGzDvmg3mtqo41Worq1SOI5yLw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)