UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3HDoTYECyio9kqbDMIduXw8iRbb1JSkyhdzGoqVV+r4='
WHERE
key_id = '29d09a9b8dea6c0fb2f70acc71adc5b7556623bbfbd1b90e04b8dd57f5e2c81f'
AND (
token = '3HDoTYECyio9kqbDMIduXw8iRbb1JSkyhdzGoqVV+r4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)