UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8qpIFBwv8RAktZ4dKA0px1HwIQ7RvHu1vCiRJMLIRzc='
WHERE
key_id = 'e366246df9ba2f7d2c5e6546ab76c7ab38772510d3190afaa9ac600ef8f35d9f'
AND (
token = '8qpIFBwv8RAktZ4dKA0px1HwIQ7RvHu1vCiRJMLIRzc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)