UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NuLfU9sQF/x+5CoBmwgQFR2uIq6B4QHqwXWi8f53sLA='
WHERE
key_id = '5d4f4c4dc1f38c7d232c5aaaa92ec18aab3d9bd40f5f70893e8868f9eb942770'
AND (
token = 'NuLfU9sQF/x+5CoBmwgQFR2uIq6B4QHqwXWi8f53sLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)