UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8s2Tpz7qgqqY9FQ3H2qGm+DazVYOO7kz2wGJGUL/MGU='
WHERE
key_id = 'af6198ff2a600db6267093b7a3e856918ce0c106b0f6d36ac5f73b8285e1a052'
AND (
token = '8s2Tpz7qgqqY9FQ3H2qGm+DazVYOO7kz2wGJGUL/MGU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)