UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mw8pYk7NDZSTdwpLLyEqXUbZrmDneS7G24aWohoZ8+k='
WHERE
key_id = 'c029a60b6424772bdd02814074bc956e26adbcc768e07730fcfc7919b9a2d368'
AND (
token = 'Mw8pYk7NDZSTdwpLLyEqXUbZrmDneS7G24aWohoZ8+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)