UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H2c0JEqvL609XtjfoUeEA7BT6YhWY4oocmTUy07C6YI='
WHERE
key_id = '94b4e5eb07a751ab2112db46dee03794b1bc0be6a5776422bd6bdb4ce104c85d'
AND (
token = 'H2c0JEqvL609XtjfoUeEA7BT6YhWY4oocmTUy07C6YI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)