UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3GCoEP3Q50QXT7jRPH4LTSkqQXc9ER3hO1NWBeY8Zdc='
WHERE
key_id = '572744dd53dd870f28359a2cae6a63d0c6094f3ad0f2d18fabdda5c029ca6f68'
AND (
token = '3GCoEP3Q50QXT7jRPH4LTSkqQXc9ER3hO1NWBeY8Zdc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)