UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xkyLo0h3JIc9DcBYx3qLYKuV+sGqFZTl3wUGR841OaQ='
WHERE
key_id = '9efcd5438e53cbdde27dc4d01ae9bbd8f85755f7e7d8f42d6e87c713d7823d7d'
AND (
token = 'xkyLo0h3JIc9DcBYx3qLYKuV+sGqFZTl3wUGR841OaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)