UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '50/pwsjDeiTghJsRqVg4qi5k/TbnEjM6vWVEIatbNBM='
WHERE
key_id = 'a7c258035cca2c2ee09a967234a93c7eaaa40d25bd76fc3820947a034a481b23'
AND (
token = '50/pwsjDeiTghJsRqVg4qi5k/TbnEjM6vWVEIatbNBM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)