UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6jQrtwGChShiLa06dEuS/xaPyqZYOQLfRBi6xyQsnd8='
WHERE
key_id = '0f2a98f32e6dd6ec528fdaf933db991c6c2289fc1e776ab3380187ecf1491e35'
AND (
token = '6jQrtwGChShiLa06dEuS/xaPyqZYOQLfRBi6xyQsnd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)