UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y2vOLCTFyclOVqaglIg9+Yb3L9rh7nuGTou78sqYS14='
WHERE
key_id = 'cb15d66d42d97dc84366aeef1c9f6fc32d7d1d9dea9302bb4ef33987ae40db17'
AND (
token = 'y2vOLCTFyclOVqaglIg9+Yb3L9rh7nuGTou78sqYS14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)