UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '11a4p7543GOI79VkCAie4zGF6ER9cf5GpY5F42x40Fk='
WHERE
key_id = '6452a7a78c7c94371fa78adc0cef087abe69667fa5ed6158a022ae9a2cc772cf'
AND (
token = '11a4p7543GOI79VkCAie4zGF6ER9cf5GpY5F42x40Fk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)