UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9xtrf8C7WAdQinK0W3opUjV1wEzLEs0rYuQbh5LH6YM='
WHERE
key_id = '0104f62a43d59131c6cc1036e1c09c3e94637a63793929d3e446959e341c0bce'
AND (
token = '9xtrf8C7WAdQinK0W3opUjV1wEzLEs0rYuQbh5LH6YM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)