UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ULxyS9rtD3YuLQWkqxKO/8g11edMDfIAKsfMmcjdwF4='
WHERE
key_id = '341781466306815a9ef98498f98bc2ba424b0c07a435f0781682719a68f341bb'
AND (
token = 'ULxyS9rtD3YuLQWkqxKO/8g11edMDfIAKsfMmcjdwF4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)