UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3hb2yIAAEZ+D/SsIKHJCl7FUyN0mllGaCmEgvnZTwB0='
WHERE
key_id = '80699475de487edf3d44e69f1a08854cbd472968041e14a1df6e4b32c981512e'
AND (
token = '3hb2yIAAEZ+D/SsIKHJCl7FUyN0mllGaCmEgvnZTwB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)