UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q7f0g73/QqnISIsjMEgtWTBTTBQm8gTFd/0soEwKYJ0='
WHERE
key_id = '958292ceca535f49713645efd897593ddb4adb91298edf9c5dfa6192ac950f81'
AND (
token = 'Q7f0g73/QqnISIsjMEgtWTBTTBQm8gTFd/0soEwKYJ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)