UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MXc3WlEcH+QfQQE0lEz+pckRaXzdDQk9l6OnlyiDGC4='
WHERE
key_id = '703b8127fda3e3c6fc9a6abdc5eae3e8e67f3cb67c2df5dd6ce88f3c10f2c36e'
AND (
token = 'MXc3WlEcH+QfQQE0lEz+pckRaXzdDQk9l6OnlyiDGC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)