UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uBTlBjnf8jzm67ZNp6715l3k5To2S8PYJlM7noKQVMg='
WHERE
key_id = 'b80a9eabc12a05f2eb60e08ad93ee5228b7cc072ab12fe044998444b38c3ad55'
AND (
token = 'uBTlBjnf8jzm67ZNp6715l3k5To2S8PYJlM7noKQVMg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)