UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4j2NgDBp+LD/mL++Q5vEl6NOf06/1kuCQn8b2Pvms4E='
WHERE
key_id = 'e65594c58441af4469822a296d6ffbabaeada0d28024dfe3867a0d446d4bb07c'
AND (
token = '4j2NgDBp+LD/mL++Q5vEl6NOf06/1kuCQn8b2Pvms4E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)