UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qT3Sy2DfsT/yEdUlemFdaKdPFz78couJW47Ba+GIKa8='
WHERE
key_id = '47a9029bfa0d2dfd68768ceb8d2000d0338927ce00a8424fbcea526c76d61067'
AND (
token = 'qT3Sy2DfsT/yEdUlemFdaKdPFz78couJW47Ba+GIKa8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)