UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yCKWRW3Ovk/bFjOjXbJIncWouIdnLRsfpxaer8kwvDs='
WHERE
key_id = '0b9452b2f99393dc1a897066fd0eb2777d5175775284370da98a4b54b3812f4d'
AND (
token = 'yCKWRW3Ovk/bFjOjXbJIncWouIdnLRsfpxaer8kwvDs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)