UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8RL3E12+LeG1g24D0KktTgU2Qjsr54GjSQ+3OPESUtY='
WHERE
key_id = '03b099e5eadd3e8f0c61851314bed0f0e0e82adc61a51470b7dab762ad480373'
AND (
token = '8RL3E12+LeG1g24D0KktTgU2Qjsr54GjSQ+3OPESUtY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)