UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6zSe8ep5aPANbAYYL1wDXUY326mYMt13jXAr9mvIlnY='
WHERE
key_id = 'c0fa9a7348e68f2f43029ee9a1447396f3dd371a891e7603ab6b1933a4e8b374'
AND (
token = '6zSe8ep5aPANbAYYL1wDXUY326mYMt13jXAr9mvIlnY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)