UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+XkpVJ+FE08NjzcC1XJAeUS35+LMKCdErXCl4hmRM7w='
WHERE
key_id = 'ce32e473a7ea5f7b22edaf486cc09f74d1840fbe2f69e2616feb75d4bb8f8e28'
AND (
token = '+XkpVJ+FE08NjzcC1XJAeUS35+LMKCdErXCl4hmRM7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)