UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '38EJuXxZgznmlLafSm+q08b6B5bUWQBT+gJe32zdJQ4='
WHERE
key_id = 'fec060f54b1cd7253f1c89f5b689565ae46e7125f7a42d8e065f2bf0fed721cd'
AND (
token = '38EJuXxZgznmlLafSm+q08b6B5bUWQBT+gJe32zdJQ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)