UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'awgODRd6zlePa5tfalLQRt8XYM7qH9RqtOGFAqbUDv4='
WHERE
key_id = 'cb2ad7465fa7b1c75e28efd7d7de966b4df19ca7d140093eec5453f7865374de'
AND (
token = 'awgODRd6zlePa5tfalLQRt8XYM7qH9RqtOGFAqbUDv4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)