UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/nTLO2mB53YNIHMsHMTEIZLOc80RCc8ceNmazhtOBqI='
WHERE
key_id = 'b14d7ae47b918ee3838422785c02fb448ee7055f10859deb231a1eed882a3071'
AND (
token = '/nTLO2mB53YNIHMsHMTEIZLOc80RCc8ceNmazhtOBqI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)