UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nve2qbxMEcwcibpvwhmzTHVOzxrOLKTOpLfp9HUKN1w='
WHERE
key_id = '5cc25d58c1f0b8ebdfa8d9af1551a59b38f85ad1fe67e68c09feada526f500be'
AND (
token = 'nve2qbxMEcwcibpvwhmzTHVOzxrOLKTOpLfp9HUKN1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)