UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RuMPjSXbTUZJpv1RRwiQWRv2jQaPetU20UX5OT6NHeo='
WHERE
key_id = '73f4233a7ecfe4b24fa5be3a85649d2af34e57f1df053d23166608a240c2e0c5'
AND (
token = 'RuMPjSXbTUZJpv1RRwiQWRv2jQaPetU20UX5OT6NHeo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)