UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WUnxjSgrHBmsW1jDdubcmUBu1C1B83sYDKF5k0diQVY='
WHERE
key_id = '1acc88b5cc5f37e3f96b7252772c27be8d8eec6dff2240dd2cf3fc7794a30a9a'
AND (
token = 'WUnxjSgrHBmsW1jDdubcmUBu1C1B83sYDKF5k0diQVY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)